home *** CD-ROM | disk | FTP | other *** search
/ NOVA - For the NeXT Workstation / NOVA - For the NeXT Workstation.iso / Documents / NeXTAnswers / objc.779 < prev    next >
Text File  |  1992-02-06  |  1KB  |  46 lines

  1. {\rtf0\ansi{\fonttbl\f0\fnil Times-Roman;\f2\fmodern Courier;\f1\fswiss Helvetica;}
  2. \paperw13600
  3. \paperh8860
  4. \margl120
  5. \margr1000
  6. {\colortbl\red0\green0\blue0;}
  7. \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\f0\b0\i0\ul0\fs28 C++ compiler crash inline functions bug workaround\
  8. \
  9. Q:  When I tried to compile some of my C++ files using the command "cc++ -g", the compiler just crashed, with a fatal signal 10.  What can I do?\
  10. \
  11. A:  This problem can be caused by your inline functions not having an argument name in the function definition.  The workaround is to name the argument.  For example, the following code snippet shows the problem and how to correct it:\
  12. \
  13.  
  14. \pard\tx1140\tx2300\tx3440\tx4600\tx5760\tx6900\tx8060\tx9200\tx10360\tx11520\f2\fs24\fc0     class Foo \{\
  15.     public:\
  16.     inline void* operator new(
  17. \b size_t
  18. \b0 )\
  19.     \{\
  20.     return FooBucket::free_list->allocate();\
  21.     \};\
  22. \
  23.  
  24. \f0\fs28 The function 
  25. \b new
  26. \b0  does not have an argument name.  The fix is simply to add an argument name:\
  27. \
  28.  
  29. \f2\fs24     class Foo \{\
  30.     public:\
  31.     inline void* operator new(
  32. \b size_t fooMember
  33. \b0 )\
  34.     \{\
  35.     return FooBucket::free_list->allocate();\
  36.     \};\
  37. \
  38. \
  39.  
  40. \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\f0\fs28\fc0 QA779\
  41. \
  42. Not Valid for 1.0\
  43. Valid for 2.0\
  44. \
  45.  
  46.